#include <tsin/library/ImageSeries.hpp>

using namespace tsin;

static void dummyNextFrame(DecoratedImage *image, int prevFrame, int curFrame)
{
}

bool ImageSeries::inquiry(BulletShape shape, BulletColor color,
                          ImageInfo &info)
{
        this->shape = shape;
        this->color = color;

        fillImageInfo(info);

        return true;
}

bool ImageSeries::inquiry(Character character, Action action,
                          ImageInfo &info)
{
        this->character = character;
        this->action = action;

        fillImageInfo(info);

        return true;
}

bool ImageSeries::inquiry(Effect effect, ImageInfo &info)
{
        this->effect = effect;

        fillImageInfo(info);

        return true;
}

BlendStyle ImageSeries::getBlendStyle()
{
        return COVERING;
}

int ImageSeries::getNrFrames()
{
        return 1;
}

NextFrameHandler ImageSeries::getHandler()
{
        return dummyNextFrame;
}

void ImageSeries::fillImageInfo(ImageInfo &info)
{
        info.path = getImagePath();
        info.x = getCoordX();
        info.y = getCoordY();
        info.w = getSizeX();
        info.h = getSizeY();
        info.blendStyle = getBlendStyle();
        info.nrFrames = getNrFrames();
        info.handler = getHandler();
}
